/**
 * 
 */
package ngat.oss.simulation.test;

import java.io.*;
import java.util.*;

import ngat.oss.simulation.*;
import ngat.util.*;

/**
 * @author snf
 *
 */
public class CreateEnvScenario {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		try {
		
		    ConfigurationProperties config = CommandTokenizer.use("--").parse(args);
	
		    EnvironmentalScenarioGenerator esg = new EnvironmentalScenarioGenerator();
						
		    // Generate a new scenario
		    File modelFile = new File(config.getProperty("model"));
		    ConfigurationProperties model = new ConfigurationProperties();
		    model.load(new FileInputStream(modelFile));
		    
		    EnvironmentalScenarioGeneratorParams esp = esg.createScenarioParams(model);
		    EnvironmentalScenario es = esg.createEnvironmentalScenario(esp);
		    File scenarioFile = new File(config.getProperty("outfile"));
		    esg.dumpScenario(es, scenarioFile);
		    
		} catch (Exception e) {
		    e.printStackTrace();
		    System.err.println("Usage: CreateEnvScenario --model <file> --outfile <file>");
		}
	}
    
}
